import React from 'react'
import { Navigate } from 'react-router-dom'
function HOCLogin(Com) {
  return (props)=>{
      const tokens = window.localStorage.getItem('tokens');
      if(!tokens){
        return <Navigate to={'/login'}></Navigate>
      }
      return <Com {...props}></Com>
  }
}

export default HOCLogin